import Vue from 'vue'
import Router from 'vue-router'
import User from '../components/User'
import Home from '../components/Home'

const HomeNews = () =>
    import ('../components/HomeNews')
const HomeMessage = () =>
    import ('../components/HomeMessage')
const ProFile = () =>
    import ('../components/ProFile')


Vue.use(Router)

export default new Router({
    routes: [{
            path: '/user/:userId',
            component: User
        },
        {
            path: "/home",
            component: Home,
            children: [{
                    path: "news",
                    component: HomeNews
                },
                {
                    path: "message",
                    component: HomeMessage
                }
                // ,
                // {
                //     path: "",
                //     redirect: "news"
                // }
            ]
        },
        {
            path: "/profile",
            component: ProFile
        },
    ]
})